let baseUrl = "https://mock.mengxuegu.com/mock/5fdc6ffb5b350029c77c973a/mxg-education-app/";

function http({url,data={},method="GET"}){           //封装http函数.
  return new Promise((resolve,reject) =>{
      uni.request({
          url:baseUrl+url,
          data,
          method,
          success:res =>{
              resolve(res);
          },
          fail:err =>{
              reject(err)
          }
      })
  })
}
export {http};